% Test of compressed TIFF file insertion
% Copyright 2007 TeX Users Group.
% You may freely use, modify and/or distribute this file.
\typesize=10pt

\offheaders

\def\decreasepageno{\global\advance\pageno-1}
\def\newpage{\vfill\eject}

% A simply TeX macro for insertion of a TIFF image.
% It also constructs a box for TeX that has the dimensions of the insert.
% The reference point of the box is at the lower left corner.
% This makes it easy to center the image and allow space for it.

\newcount\ncolumns
\newcount\nrows
\newdimen\dwidth
\newdimen\dheight

% Arguments to showtiff are: file-name, desired width, columns, rows.
% The number of columns and rows in the TIFF image may be found using TIFFTAGS
% The height is computed from the widths so as to preserve the aspect ratio.

\def\showtiff#1#2#3#4{
\dwidth=#2\dheight=#2
\ncolumns=#3\nrows=#4
\divide\dheight by \ncolumns
\multiply\dheight by \nrows
\edef\width{\number\dwidth}
\edef\height{\number\dheight}
{\vbox to \dheight{\vfill\hbox to \dwidth{
\special{insertimage: #1 \width \space \height}\hfill}}}}

% *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 

% \newpage

\noindent c:/tiff/24bitclr.tif. This is followed by a 4.2 inch gap LZW

% \vskip 4.2in

% \centerline{\hbox to 3.6in{\showimage{c:/tiff/24bitclr.tif}{3.6in}{4.2in}\hfill}}

\centerline{\showtiff{c:/tiff/24bitclr.tif}{3.6in}{180}{210}}

\noindent c:/tiff/24bitclr.tif. That was an image of a cat. 
LZW RGB color.

% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% 

\newpage

\noindent c:/tiff/flam8-l.tif --- 416 by 410 (8) --- LZW

\centerline{\showtiff{c:/tiff/flam8-l.tif}{4.16in}{416}{410}}

\noindent c:/tiff/flam8-l.tif. That was an image of a flamingo. 
LZW Palette Color.

% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% 

\newpage

\noindent c:/tiff/kep2-c.tif --- 1496 by 1250 (1) --- CCIT 3

\centerline{\showtiff{c:/tiff/kep2-c.tif}{5in}{1496}{1250}}

\noindent c:/tiff/kep2-c.tif. That was an image of a car chassis.
TIFF CCITT - inverted gray.

% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% 

\newpage

\noindent c:/tiff/biker.tif --- 928 by 1096 (1) --- CCITT

\centerline{\showtiff{c:/tiff/biker.tif}{4.65in}{928}{1096}}

\noindent c:/tiff/biker.tif. That was an image of a biker.
TIFF CCITT - inverted gray.

% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% 

\newpage

\noindent c:/tiff/cow.tif --- 1328 by 768 (1) --- CCIT 3

\centerline{\showtiff{c:/tiff/cow.tif}{4.42in}{1328}{768}}

\noindent c:/tiff/cow.tif. That was an image of a cow. % (CCIT 3 compression)
TIFF CCITT - inverted gray.

% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% 

\newpage

\noindent c:/tiff/logotype.tif --- 684 by 84 (8) --- LZW

\centerline{\showtiff{c:/tiff/logotype.tif}{3.4in}{684}{84}}

\noindent c:/tiff/logotype.tif. That was an image of a logotype.
LZW.

\vskip .25in

\noindent c:/tiff/maze.tif --- 1248 by 1136 (1) --- CCITT

\centerline{\showtiff{c:/tiff/maze.tif}{5in}{1248}{1136}}

\noindent c:/tiff/maze.tif. That was an image of a maze.
TIFF CCITT - inverted gray.

% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% 

\newpage

\noindent c:/tiff/italic.tif --- 801 by 1073 (1) % --- (LZW?)

\centerline{\showtiff{c:/tiff/italic.tif}{4in}{801}{1073}}

\noindent c:/tiff/italic.tif. That was an image of an italic.
Inverted gray.

% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% 

\newpage

\noindent c:/tiff/aldus.tif --- 109 by 139 (1) --- LZW

\centerline{\showtiff{c:/tiff/aldus.tif}{2.18in}{109}{139}}

\noindent c:/tiff/aldus.tif. That was an image of an Aldus.
LZW - inverted gray.

\vskip .15in

\noindent c:/tiff/anchor.tif --- 140 by 168 (8) % --- (LZW?)

\centerline{\showtiff{c:/tiff/anchor.tif}{2.8in}{140}{168}}

\noindent c:/tiff/anchor.tif. That was an image of an anchor.
Inverted gray.

% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% 

\newpage

\noindent \verb@c:/tiff/photog_l.tif@ --- 300 by 416 (4) --- LZW

\centerline{\showtiff{c:/tiff/photog_l.tif}{3in}{300}{416}}

\noindent \verb@c:/tiff/photog_l.tif@ --- that was an image of a photographer.
LZW.

% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%% %%%

%% color format is not supported by blackice TIFF 3 * 1 bits !!!

% \noindent c:/designer/samples/trace.tif --- 467 by 122 (3 * 1) --- LZW

% \centerline{\showtiff{c:/designer/samples/trace.tif}{4.67in}{467}{122}}

% \noindent c:/designer/samples/trace.tif. That was an image of a trace.

%% following is the same as aldus.tif

% \noindent c:/pm4/tutorial/basics/practice.tif --- 109 by 139 (1) --- LZW

% \centerline{\showtiff{c:/pm4/tutorial/basics/practice.tif}{2.2in}{109}{139}}

% \noindent c:/pm4/tutorial/basics/practice.tif. That was practice.

% \newpage

%% color format is not supported by blackice TIFF 3 * 1 bits !!!

% \noindent c:/designer/samples/trace.tif --- 467 by 122 (3 * 1) --- LZW

% \centerline{\showtiff{c:/designer/samples/trace.tif}{4.67in}{467}{122}}

% \noindent c:/designer/samples/trace.tif. That was an image of a trace.

\end
